package com.example.hotelrear.controller;

import com.example.hotelrear.entity.ResponseResult;
import com.example.hotelrear.entity.Room;
import com.example.hotelrear.service.CollectionService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author FengXiao
 * @since 2023-08-28
 */
@RestController
@RequestMapping("/collection")
public class CollectionController {
    @Resource
    private CollectionService collectionService;
    @GetMapping("/findLikeRoomByUserId")
    public ResponseResult findLikeRoomByUserId(int id) {
        List<Room> likeroom=collectionService.findLikeRoomByUserId(id);
        return ResponseResult.ok(likeroom);
    }
}
